Component({
  data: {
    showMeesageDot: false,
    showMineDot: false,
    hide: false,
    selected: null,
    color: '#1a1a1a',
    selectedColor: '#1a1a1a', // 59b6d7
    borderStyle: 'black',
    list: [
      {
        pagePath: '/pages/match/list/list',
        iconPath: '/images/ico_tabar_home@2x.png',
        selectedIconPath: '/images/ico_tabar_home_on@2x.png',
        text: '首页',
      },
      // {
      //   pagePath: '/pages/mallList/mallList',
      //   iconPath: '/images/ico_tabar_mall@2x.png',
      //   selectedIconPath: '/images/ico_tabar_mall_on@2x.png',
      //   text: '商城',
      // },
      {
        pagePath: '/pages/match/team/team',
        iconPath: '/images/ico_tabar_team.png',
        selectedIconPath: '/images/ico_tabar_team.png',
        text: '球员',
      },
      {
        pagePath: '/pages/rank/rank',
        iconPath: '/images/ico_tabar_bang.png',
        selectedIconPath: '/images/ico_tabar_bang.png',
        text: '排行榜',
      },
      {
        pagePath: '/pages/user/user',
        iconPath: '/images/ico_tabar_me@2x.png',
        selectedIconPath: '/images/ico_tabar_me_on@2x.png',
        text: '我',
      },
    ],
  },
  attached() {
    console.log('------attached')
  },
  methods: {
    switchTab(e: any) {
      const data = e.currentTarget.dataset
      const url = data.path
      this.data.selected = data.index
      this.setData({
        selected: data.index,
      })
      wx.switchTab({ url })
    },
  },
})
